from keras.layers import Dense, Activation
from keras.models import Sequential

model = Sequential()  # 顺序模型

# 输入层
model.add(Dense(7, input_shape=(4,)))  # Dense作第一层要写input—_shape
model.add(Activation('sigmoid'))  # 激活函数

# 隐藏层
model.add(Dense(13))  # Dense层为中间层
model.add(Activation('sigmoid'))  # 激活函数

# 输出层
model.add(Dense(5))
model.add(Activation('softmax'))  # 激活函数

summary = model.summary()
print(summary)

model.compile(optimizer='adam', loss='categorical_crossentropy', metrics=["accuracy"])
